// strtok 字符串分割
/*
ashjdg
sajfhga
akshgdf
ajhsgd
*/
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
    int i = 0;
    char str[32] = "ashjdg;sajfhga;akshgdf;;ajhsgd";
    char *p[10] = {str};

    // 字符串分割
    while ((p[i] = strtok(p[i], ";")) && ++i)
        /*do nothing*/;

    // 输出
    i = 0;
    while (p[i] != NULL)
    {
        printf("%s\n", p[i]);
        i++;
    }
    return 0;
}